<?php
/**
 * Created by PhpStorm.
 * User: henryxi-mac
 * Date: 2015/5/5
 * Time: 11:03
 */

if(!function_exists('getIP')) {
    function getIP()
    {
        $ip = getenv('REMOTE_ADDR');
        $ip_ = getenv('HTTP_X_FORWARDED_FOR');
        if (($ip_ != "") && ($ip_ != "unknown")) {
            $ip = $ip_;
        }
        return $ip;
    }
}